package com.goodfather.textbook.youdao.pad.weight;

import android.content.Context;
import android.view.LayoutInflater;

import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

/**
 * Created by zerup on 17/4/17.
 */

public abstract class RecyclerViewBaseAdapter<T> extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    protected Context mContext;
    protected List<T> mData;
    protected LayoutInflater mInflater;
    public RecyclerViewBaseAdapter(Context context, List<T> data) {
        mContext = context;
        mData = data;
        mInflater = LayoutInflater.from(mContext);
    }

    @Override
    public int getItemCount() {
        return mData == null ? 0 : mData.size();
    }
}
